//导入组件
import Home from './pages/Home'
import CityList from './pages/CityList'
import Map from './pages/Map/index'
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'  //导入路由
function App() {
  return (
    <Router>
      <div className="App">
        {/* 配置默认路由 路由重定向到首页*/}
        <Route path="/" render={() => <Redirect to="/home" />} />
        {/* 配置路由 */}
        <Route path="/home" component={Home} />
        <Route path="/citylist" component={CityList} />
        <Route path="/map" component={Map} />
      </div>
    </Router>
  );
}

export default App;
